FROM node:18-alpine

# 安装pnpm
RUN npm install -g pnpm

WORKDIR /app

# 复制package.json和pnpm-lock.yaml (如果有)
COPY package*.json pnpm-lock.yaml* ./

# 使用pnpm安装依赖
RUN pnpm install

# 复制源代码
COPY . .

# 构建TypeScript
RUN npm run build:ts

# 暴露端口
EXPOSE 3001

# 启动应用
CMD ["npm", "start"]
